//
//  YDOAAddStockVC.swift
//  YDOAProduct
//
//  Created by 占益民 on 2017/11/23.
//  Copyright © 2017年 Allen. All rights reserved.
//

import UIKit
import Toaster
class YDOAAddStockVC: UIViewController {
    @IBOutlet weak var goodsNameTF: UITextField!
    
    @IBOutlet weak var goodsTypeTF: UITextField!
    @IBOutlet weak var remarkTF: UITextField!
    @IBOutlet weak var amountTF: UITextField!
    @IBOutlet weak var danweiTF: UITextField!
    @IBOutlet weak var priceTF: UITextField!
    @IBOutlet weak var remainTF: UITextField!
    @IBOutlet weak var guigeTF: UITextField!
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "添加库存"
        self.navigationController?.navigationBar.isHidden = false
        self.automaticallyAdjustsScrollViewInsets = false
        self.edgesForExtendedLayout = .init(rawValue: 0)
        
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    //添加
    @IBAction func sureBtnClick(_ sender: Any) {
        let params = ["u_id":"1"]
        YMNetworkManager().postRequset(urlString: "", params: params, success: { (responser) in
            if responser["status"]?.int8Value == 1{
                Toast(text: responser["message"] as? String, delay: 0, duration: 1.5).show()
                
            }else{
                Toast(text: responser["message"] as? String, delay: 0, duration: 1.5).show()
            }
        }) { (error) in
            
        }
        
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        view.endEditing(true)
    }

}


extension  YDOAAddStockVC : UITextFieldDelegate {
    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        textField.returnKeyType = .done
        textField.resignFirstResponder()
        return true
    }
}
